import request from '@/utils/request'

// 查询收款记录列表
export function listPayment(query) {
  return request({
    url: '/orders/payment/list',
    method: 'get',
    params: query
  })
}

// 查询收款记录详细
export function getPayment(id) {
  return request({
    url: '/orders/payment/' + id,
    method: 'get'
  })
}

// 新增收款记录
export function addPayment(data) {
  return request({
    url: '/orders/payment',
    method: 'post',
    data: data
  })
}

// 修改收款记录
export function updatePayment(data) {
  return request({
    url: '/orders/payment',
    method: 'put',
    data: data
  })
}

// 删除收款记录
export function delPayment(id) {
  return request({
    url: '/orders/payment/' + id,
    method: 'delete'
  })
}

// 获取支付状态选项
export function getPaymentStatusOptions() {
  return request({
    url: '/orders/payment/paymentStatusOptions',
    method: 'get'
  })
}

// 获取支付方式选项
export function getPaymentMethodOptions() {
  return request({
    url: '/orders/payment/paymentMethodOptions',
    method: 'get'
  })
}

// 根据订单号查询支付记录
export function getPaymentByOrderId(orderId) {
  return request({
    url: '/orders/payment/getByOrderId/' + orderId,
    method: 'get'
  })
}
